/**
 * 
 */
package tau.adx.common.enteties.ranking;

import tau.adx.common.adn.AdNetwork;
import tau.adx.common.contracts.MonthlyContract;
import tau.adx.common.messages.auction.AuctionWon;

import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;

/**
 * A ranking agency for {@link AdNetwork}s throughout the system. Holds data
 * about past actions and {@link MonthlyContract contracts} for each
 * {@link AdNetwork} and asses their ranking.
 * 
 * @author greenwald
 * 
 */
public interface RankingAgency {

	/**
	 * @param auctionWon
	 *            {@link AuctionWon} notification from the {@link EventBus}.
	 */
	@Subscribe
	public void bidWon(AuctionWon auctionWon);

	/**
	 * Returns the ranking of an {@link AdNetwork} according to past actions and
	 * {@link MonthlyContract contracts}.
	 * 
	 * @param adNetwork
	 *            {@link AdNetwork} to get ranking for.
	 * 
	 * @return Ranking of given {@link AdNetwork}.
	 */
	public Double getRanking(AdNetwork adNetwork);

	/**
	 * Clears all data stored in the {@link RankingAgency}.
	 */
	public void clear();

}
